package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QuestionsMapper;
import com.ruoyi.system.domain.Questions;
import com.ruoyi.system.service.IQuestionsService;

/**
 * 题目管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-09
 */
@Service
public class QuestionsServiceImpl implements IQuestionsService 
{
    @Autowired
    private QuestionsMapper questionsMapper;

    /**
     * 查询题目管理
     * 
     * @param questionId 题目管理主键
     * @return 题目管理
     */
    @Override
    public Questions selectQuestionsByQuestionId(Long questionId)
    {
        return questionsMapper.selectQuestionsByQuestionId(questionId);
    }

    /**
     * 查询题目管理列表
     * 
     * @param questions 题目管理
     * @return 题目管理
     */
    @Override
    public List<Questions> selectQuestionsList(Questions questions)
    {
        return questionsMapper.selectQuestionsList(questions);
    }

    /**
     * 新增题目管理
     * 
     * @param questions 题目管理
     * @return 结果
     */
    @Override
    public int insertQuestions(Questions questions)
    {
        questions.setCreateTime(DateUtils.getNowDate());
        return questionsMapper.insertQuestions(questions);
    }

    /**
     * 修改题目管理
     * 
     * @param questions 题目管理
     * @return 结果
     */
    @Override
    public int updateQuestions(Questions questions)
    {
        questions.setUpdateTime(DateUtils.getNowDate());
        return questionsMapper.updateQuestions(questions);
    }

    /**
     * 批量删除题目管理
     * 
     * @param questionIds 需要删除的题目管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionsByQuestionIds(Long[] questionIds)
    {
        return questionsMapper.deleteQuestionsByQuestionIds(questionIds);
    }

    /**
     * 删除题目管理信息
     * 
     * @param questionId 题目管理主键
     * @return 结果
     */
    @Override
    public int deleteQuestionsByQuestionId(Long questionId)
    {
        return questionsMapper.deleteQuestionsByQuestionId(questionId);
    }
}
